package cn.ac.iscas.service.softwareCopyright;

import java.util.Set;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.ac.iscas.bean.base.DAOSupport;
import cn.ac.iscas.bean.patent.Patent;
import cn.ac.iscas.bean.patent.PatentPicture;
import cn.ac.iscas.bean.softwareCopyright.SoftwareCopyright;
import cn.ac.iscas.bean.softwareCopyright.SoftwarePicture;
import cn.ac.iscas.service.paper.IPaperDocumentService;
@Service
@Transactional
public class SoftwareCopyrightServiceImp extends DAOSupport<SoftwareCopyright> implements ISoftwareCopyrightService {
	@Resource private ISoftwarePictureService softwarePictureService;
	@Override
	public void delete(Object entity) {
		SoftwareCopyright softwareCopyright= (SoftwareCopyright)entity;
		Set<SoftwarePicture> docs = softwareCopyright.getPicturePaths();
		for(SoftwarePicture file:docs)
		{
			System.out.println(file.getPictureName());
			softwarePictureService.delete(file);
		}
		super.delete(softwareCopyright);
	}
}
